home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Softdisk Supreme
/
Softdisk Supreme.iso
/
pc
/
DSK Files
/
0-49
/
SD001b.dsk
/
SCMAFM.bas
< prev
next >
Wrap
BASIC Source File
|
2003-06-12
|
7KB
|
233 lines
5 REM SCMAFM - SCHEMA FILE MAINT
10 D$ = CHR$(4)
12 LM = 10
15 ONERR GOTO 9000
16 HOME
17 PRINT "SCMA FILE MAINT"
18 GOSUB 9400: INPUT "ENTER NAME OF MASTER FILE ";NF$
20 IF LEN(NF$) <13 GOTO 25
21 PRINT "MAX NAME LENGTH IS 12": GOTO 18
25 PRINT D$"OPEN SCMA-"NF$",L60"
30 PRINT D$"READ SCMA-"NF$",R0"
50 INPUT FP: INPUT FT$: INPUT NF$: INPUT RL: INPUT LR
51 FP = FP -100
52 INPUT NF: INPUT NV: INPUT ND: INPUT NS
55 POKE 216,0
56 PRINT D$
60 HOME
61 INPUT "DO YOU WANT TO SEE SCMA?";R$
62 IF R$ = "Y" GOTO 6000
64 HOME
65 PRINT "SCMA CHANGE PROCEDURE NOT PROGRAMMED YET"
66 PRINT "YOU MUST DELETE SCMA-FILE AND CREATE A NEW ONE"
67 PRINT "IF YOU WANT TO CHANGE IT"
68 GOTO 9500
70 HOME
80 PRINT "REMEMBER 1ST DATA FIELD IS THE FILE KEY": PRINT
90 GOTO 230
100 GOSUB 9400: PRINT "TYPE OF DATA"
110 PRINT " N = NUMERIC"
120 PRINT " C = CHARACTER"
150 INPUT R$
160 IF R$ = "N" GOTO 190
170 IF R$ = "C" GOTO 400
180 GOTO 100
190 TY$ = "N": GOTO 300
230 GOSUB 9400: INPUT "NAME OF DATA FIELD ";DN$
231 IF LEN(DN$) <13 GOTO 250
235 PRINT "*** MAX NAME LENGTH IS 12 CHARACTERS": GOTO 230
250 GOSUB 9400: INPUT "REQUIRED ON ADD, Y OR N?";RQ$
260 IF RQ$ = "Y" GOTO 100
270 IF RQ$ = "N" GOTO 100
280 GOTO 250
300 GOSUB 9400: INPUT "MINIMUM VALUE ";MN
310 GOSUB 9400: INPUT "MAXIMUN VALUE ";MX
350 GOSUB 9400: INPUT "DEFAULT VALUE ";DV
352 GOSUB 9400: INPUT "SATISFIED WITH THIS DATA FIELD?";R$
354 IF R$ = "N" GOTO 90
356 IF R$ = "Y" GOTO 359
358 GOTO 352
359 MN$ = STR$(MN):MX$ = STR$(MX)
360 IF LEN(MX$) > LEN(MN$) GOTO 362
361 LM = LM + LEN(MN$) +1: GOTO 363
362 LM = LM + LEN(MX$) +1
363 LR = LR +1
364 PRINT D$"WRITE SCMA-"NF$",R"LR
365 FP = LR +1
370 PRINT FP +100: PRINT TY$: PRINT DN$: PRINT RQ$: PRINT MN: PRINT MX: PRINT DV
380 PRINT D$
385 NF = NF +1
387 IF NF = 1 AND FT$ = "S" GOTO 230
390 GOTO 1000
400 TY$ = "C"
500 GOSUB 9400: INPUT "MAXIMUM LENGTH ";ML
505 IF ML <31 GOTO 540
510 PRINT "*** MAX DATA FIELD LENGTH IS 30": GOTO 500
540 GOSUB 9400: INPUT "DEFAULT VALUE ";DV$
541 IF LEN(DV$) <ML +1 GOTO 551
550 PRINT "DEFAULT VAL LONGER THAN MAX FIELD LENGTH": GOTO 540
551 IF LEN(DV$) <6 GOTO 554
552 ND = ND +1
553 GOTO 555
554 NS = NS +1
555 VP = 0
556 GOSUB 9400: INPUT "SATISFIED WITH THIS DATA FIELD?";R$
557 IF R$ = "N" GOTO 90
558 IF R$ = "Y" GOTO 560
559 GOTO 556
560 LM = LM +ML +1
561 IF ML >5 GOTO 591
565 GOSUB 9400: INPUT "DO YOU WANT TO SPECIFY VALID VALUES?";R$
570 IF R$ = "N" GOTO 600
580 IF R$ = "Y" GOTO 595
590 GOTO 560
591 R$ = "N": GOTO 600
595 VP = LR +2
600 LR = LR +1
602 PRINT D$"WRITE SCMA-"NF$",R"LR
610 FP = LR +1
620 PRINT FP +100: PRINT TY$: PRINT VP: PRINT DN$: PRINT RQ$: PRINT ML: PRINT DV$
630 PRINT D$
635 NF = NF +1
640 IF R$ = "N" GOTO 1000
650 CR = LR
660 TY$ = "V"
680 GOSUB 9400: INPUT "VALID VALUE ";VV$
681 IF LEN(VV$) <ML +1 GOTO 690
682 PRINT "LENGTH OF VALID VALUE > DATA FIELD LENGTH": GOTO 680
690 GOSUB 9400: INPUT "MEANING ";MV$
691 IF LEN(MV$) <13 GOTO 693
692 PRINT "MAX LENGTH OF MEANING IS 12": GOTO 690
693 GOSUB 9400: INPUT "SATISFIED WITH THIS VALID VALUE?";R$
694 IF R$ = "N" GOTO 680
696 IF R$ = "Y" GOTO 700
698 GOTO 693
700 LR = LR +1
720 GOSUB 9400: INPUT "ANY MORE VALID VALUES?";R$
730 IF R$ = "N" GOTO 780
740 IF R$ = "Y" GOTO 760
750 GOTO 720
760 FP = LR +1
770 GOTO 790
780 FP = 0
790 PRINT D$"WRITE SCMA-"NF$",R"LR
800 PRINT FP +100: PRINT TY$: PRINT MV$: PRINT VV$
810 PRINT D$
815 NV = NV +1
820 IF R$ = "Y" GOTO 680
830 FP = LR +1
840 PRINT D$"WRITE SCMA-"NF$",R"CR
850 PRINT FP +100
855 PRINT D$
860 GOTO 1000
900 LR = LR +1
910 PRINT D$"WRITE SCMA-"NF$",R"LR
920 PRINT 100: PRINT "E"
925 PRINT D$
926 HOME
927 IF LM <30 GOTO 929
928 GOTO 930
929 LM = 30
930 PRINT D$"WRITE SCMA-"NF$",R0"
940 PRINT 101: PRINT FT$: PRINT NF$: PRINT LM: PRINT LR
945 PRINT NF: PRINT NV: PRINT ND: PRINT NS
950 PRINT D$
960 HOME
970 PRINT "SCMA IS CREATED"
980 GOTO 9500
1000 PRINT D$
1010 GOSUB 9400: INPUT "ANY MORE DATA FIELDS?";R$
1020 IF R$ = "Y" GOTO 90
1030 IF R$ = "N" GOTO 900
1040 GOTO 1010
6000 REM
6001 INPUT "TURN ON PRINTER, THEN HIT RETURN";R$
6005 PRINT D$"PR#1"
6006 PRINT
6010 GOSUB 9400
6020 PRINT "FILE NAME = ";NF$;" REC LENGTH = ";RL
6025 PRINT "TYPE = ";
6030 IF FT$ = "S" GOTO 6034
6032 PRINT "KEYED": GOTO 6040
6034 PRINT "SEQUENTIAL"
6040 PRINT D$"READ SCMA-"NF$",R"FP
6050 INPUT FP: INPUT TY$:FP = FP -100
6060 IF TY$ = "V" GOTO 6080
6070 IF FP = 0 GOTO 6350
6080 IF TY$ = "N" GOTO 6130
6090 IF TY$ = "C" GOTO 6200
6100 IF TY$ = "V" GOTO 6300
6110 PRINT "*** SCMA IS MESSED UP"
6120 GOTO 9500
6130 INPUT DN$: INPUT RQ$: INPUT MN: INPUT MX: INPUT DV
6140 GOSUB 9400
6145 PRINT DN$;" (NUMERIC)"
6150 PRINT "MIN = ";MN;" MAX = ";MX
6160 PRINT "DEFAULT = ";DV;" ";
6170 IF RQ$ = "Y" GOTO 6190
6180 PRINT "NOT REQUIRED ON ADD": GOTO 6040
6190 PRINT "REQUIRED ON ADD": GOTO 6040
6200 INPUT VP: INPUT DN$: INPUT RQ$: INPUT ML: INPUT DV$
6205 GOSUB 9400
6210 PRINT DN$;" (CHARACTER)"
6220 PRINT "MAX LENGTH = ";ML;" ";
6230 IF RQ$ = "Y" GOTO 6250
6240 PRINT "NOT REQUIRED ON ADD": GOTO 6260
6250 PRINT "REQUIRED ON ADD"
6260 IF DV$ = "" GOTO 6265
6261 GOTO 6270
6265 DV$ = "BLANK"
6270 PRINT "DEFAULT = ";DV$
6280 IF VP = 0 GOTO 6040
6290 CR = FP:FP = VP: GOTO 6040
6300 INPUT MV$: INPUT VV$
6310 PRINT VV$;"=";MV$
6320 IF FP = 0 GOTO 6340
6330 GOTO 6040
6340 FP = CR: GOTO 6040
6350 GOSUB 9400
6360 PRINT "END OF SCMA": GOTO 9500
9000 PRINT D$
9005 POKE 216,0
9010 HOME
9020 PRINT "NO SCMA FILE FOUND"
9030 INPUT "DO YOU WANT TO CREATE ONE?";R$
9050 IF R$ = "N" GOTO 9090
9060 IF R$ = "Y" GOTO 9130
9070 PRINT "REPLY Y OR N"
9080 GOTO 9030
9090 HOME
9100 PRINT "MOUNT DISKETTE WITH SCMA-";NF$
9101 PRINT "ON IT AND RERUN"
9110 PRINT D$"DELETE SCMA-"NF$
9120 GOTO 9999
9130 NF = 0:NV = 0:ND = 0:NS = 0
9132 HOME : PRINT "KEYED OR SEQUENTIAL?": PRINT : PRINT
9134 PRINT "RECORD KEYS ON A KEYED FILE MUST BE"
9135 PRINT " UNIQUE."
9136 PRINT : PRINT "RECORDS ON A KEYED FILE MAY BE"
9137 PRINT " RETRIVED BY KEY."
9138 PRINT : PRINT "RECORDS ON A SEQUENTIAL FILE ARE MADE"
9139 PRINT "AVAILABLE IN THE SAME ORDER THEY ARE"
9140 PRINT " PUT IN."
9141 PRINT : PRINT : PRINT " 1=KEYED": PRINT " 2=SEQUENTIAL": PRINT " 3=QUIT"
9142 INPUT R$: IF R$ = "1" GOTO 9150
9144 IF R$ = "2" GOTO 9148
9146 GOTO 9110
9148 FT$ = "S": GOTO 9161
9150 FT$ = "Z"
9161 PRINT D$"DELETE SCMA-"NF$
9162 PRINT D$"OPEN SCMA-"NF$",L60"
9170 PRINT D$"WRITE SCMA-"NF$",R0"
9175 FP = 1
9180 PRINT FP +100: PRINT FT$: PRINT NF$: PRINT 0: PRINT 0
9185 PRINT 0: PRINT 0: PRINT 0: PRINT 0
9190 IF FT$ = "Z" GOTO 9230
9192 DN$ = "RECORD NBR":RQ$ = "Y":TY$ = "N":MN = 1:MX = 9999:DV = 0: GOTO 359
9230 PRINT D$
9240 GOTO 70
9400 PRINT "------------------------------------"
9410 RETURN
9500 PRINT D$"CLOSE SCMA-"NF$
9510 PRINT D$"PR#0"
9999 PRINT D$"RUN JELLO"